{extend name='admin@main'}

{block name="button"}

{if auth("activity/index/add")}
<button data-open='{:url("add")}' data-title="添加活动" class='layui-btn layui-btn-sm layui-btn-primary'>添加活动</button>
{/if}

{if auth("activity/index/del")}
<button data-action='{:url("del")}' data-rule="id#{key}" data-csrf="{:systoken('activity/index/del')}"
        data-confirm="确定要删除这些活动吗？" class='layui-btn layui-btn-sm layui-btn-primary'>删除活动
</button>
{/if}

{/block}

{block name="content"}
<table class="layui-table" lay-skin="line">
    <caption class="margin-bottom-10 text-left">{include file='index/index_search'}</caption>
    {notempty name='list'}
    <thead>
    <tr>
        <th class='list-table-check-td think-checkbox'>
            <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
        </th>
        <th class='text-left nowrap' style="">ID</th>
        <th class='text-left nowrap' style="">排序</th>
        <th class='text-left nowrap' style="">活动名</th>
        <th class='text-left nowrap' style="">活动封面</th>
        <th class='text-left nowrap' style="">报名开始日期</th>
        <th class='text-left nowrap' style="">活动开始日期</th>
        <th class='text-left nowrap' style="">活动地点</th>
        <th class='text-left nowrap' style="">状态</th>
        <th class='text-left nowrap' style="">报名人数</th>
        <th class='text-left nowrap' style="">创建时间</th>
        <th class='text-left nowrap' style="">赛程组别</th>
        <th class='text-left nowrap' style="">参赛套餐</th>
        <th class='text-left nowrap' style="">可选服务</th>
        <th class='text-left nowrap' style="">首页显示</th>
        <th class='text-left nowrap'></th>
    </tr>
    </thead>
    {/notempty}
    <tbody>
    {foreach $list as $key=>$vo}
    <tr data-dbclick>
        <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'>
        </td>
        <td class='text-left nowrap'>
            {$vo.id|default=''}
        </td>
        <td class='list-table-sort-td'><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input"></td>
        <td class='text-left nowrap'>
            {$vo.name|default=''}
        </td>
        <td class='text-left nowrap'>
            <img src="{$vo.pic|default=0}" alt="" style="width: 40px;height: 40px">
        </td>
        <td class='text-left nowrap'>
            {$vo.apply_start_time|date='Y-m-d'}
        </td>
        <td class='text-left nowrap'>
            {$vo.start_time|date='Y-m-d'}
        </td>
        <td class='text-left nowrap'>
            {$vo.place|default=''}
        </td>
        <td class='text-left nowrap'>
            {$statusTitle[$vo['status']]|default=''}
        </td>
        <td class='text-left nowrap'>
            {$vo.count|default=''}
        </td>
        <td class='text-left nowrap'>
            {$vo.create_time|date='Y-m-d'}
        </td>
        <td class='text-left nowrap'>
            <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑组别" data-open='{:url("Group/index")}?activity_id={$vo["id"]}'>编辑组别</a>
        </td>
        <td class='text-left nowrap'>
            <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑套餐" data-open='{:url("Package/index")}?activity_id={$vo["id"]}'>编辑套餐</a>
        </td>
        <td class='text-left nowrap'>
            <a data-dbclick class="layui-btn layui-btn-sm" data-title="关联服务" data-modal='{:url("addProduct")}?activity_id={$vo["id"]}'>关联服务</a>
        </td>
        <td class='text-left nowrap'>
            {if condition="$vo['is_show_index'] eq 1"}
            <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('showIndex')}" data-value="id#{$vo.id};status#0">隐藏</a>
            {else}
            <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('showIndex')}" data-value="id#{$vo.id};status#1">显示</a>
            {/if}
        </td>
        <td class='text-left nowrap'>
            {if auth("activity/index/edit")}
            <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑活动" data-open='{:url("edit")}?id={$vo.id}'>编
                辑</a>
            {/if}

            {if auth("activity/index/del")}
            <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该活动吗？" data-action="{:url('del')}"
               data-value="id#{$vo.id}" data-csrf="{:systoken('activity/index/del')}">删 除</a>
            {/if}
        </td>
    </tr>
    {/foreach}
    </tbody>
</table>

{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

{/block}


{block name='script'}
<script>

</script>
{/block}